package ar.com.sne.model.composer.per;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.zkoss.zk.ui.Component;
import org.zkoss.zul.api.Textbox;

import foundation.common.util.CommonWebUtil;
import foundation.common.util.FinderFilter;
import foundation.common.util.PagedFinder;
import foundation.web.flow.AbstractPagingComposer;
import ar.com.sne.model.bo.per.PerPersona;
import ar.com.sne.model.service.geo.GeoTelefonoService;
import ar.com.sne.model.service.per.PerClienteService;


@Service
@Scope("prototype")
public class AdministracionTelefonosComposer  extends
AbstractPagingComposer {
	
	private final Log log = LogFactory.getLog(getClass());
	
	@Resource
	private GeoTelefonoService geoTelefonoService;
	private PerPersona perPersona;
	
	@Override
	public void doAfterCompose(Component comp) throws Exception {
		// TODO Auto-generated method stub
		super.doAfterCompose(comp);
		perPersona =(PerPersona)CommonWebUtil.getParameter(PerPersona.class.getSimpleName());
		if(perPersona != null){
			onClick$searchButton();
		}
	}
	
	
	@Override
	protected PagedFinder searchPaging(PagedFinder pf) {
		return geoTelefonoService.findPaging(pf);
	}
	
	
	@Override
	protected FinderFilter setterFilters() {
		FinderFilter filter = new FinderFilter();
		filter.addFilter("perPersona", perPersona);
		return filter;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @seecoop.foundation.zk.crud.composer.AbstractCRUDManagerComposer#
	 * getEditPageName()
	 */
	protected String getEditPageName() {
		return "edicionTelefonos";
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @seecoop.foundation.zk.crud.composer.AbstractCRUDManagerComposer#
	 * clearFilterCriteriaFields()
	 */
	@Override
	protected void clearFilterCriteriaFields() {
	}

	
}
